import req from '../utils/request';
import * as url from '../constants/api';

/**
 * @summary 获取组织架构的列表
 */
export function getDepartmentInfo () {
    return req({
        method: 'GET',
        url: url.DEPARTMENT,
    });
}

/**
 * @summary 获取负责人列表
 */
export function getManagerList () {
    return req({
        method: 'GET',
        url: url.MANAGER_LIST,
    });
}

/**
 * @summary 新增子部门
 */
 export function addChildDepartment (params) {
    return req({
        method: 'POST',
        url: url.DEPARTMENT,
        data: params,
    });
}

/**
 * @summary 修改部门
 */
 export function editDepartment (params, id) {
    return req({
        method: 'POST',
        url: `${ url.DEPARTMENT }/${ id }`,
        data: params,
    });
}

/**
 * @summary 删除部门
 */
 export function removeDepartment (id) {
    return req({
        method: 'DELETE',
        url: `${ url.DEPARTMENT }/${ id }`,
    });
}
